home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DMAKE38B.ARJ / DBUG.MK < prev    next >
Text File  |  1991-05-06  |  2KB  |  67 lines

  1. # Set the proper macros based on whether we are making the debugging version
  2. # or not.  The valid parameters to this file are:
  3. #
  4. #    DEBUG=1        ==> enable the making of the DBUG version
  5. #    DBMALLOC=1    ==> enable DBUG version with extensive MALLOC checking
  6. #
  7. #    DB_CFLAGS    ==> CFLAGS is set to this value at the end if DEBUG=1
  8. #    DB_LDFLAGS    ==> LDFLAGS is set to this at the end if DEBUG=1
  9. #    DB_LDLIBS       ==> LDLIBS is set to this at end if DEBUG=1
  10. #
  11. # The non debug versions of the above three macros are:
  12. #
  13. #    NDB_CFLAGS
  14. #    NDB_LDFLAGS
  15. #    NDB_LDLIBS
  16. #
  17. # One of the set of three should have values set appropriately prior to
  18. # sourcing this file.
  19.  
  20. .IF $(DEBUG)
  21.    DBUG_SRC    += dbug.c
  22.    DB_CFLAGS    += -Idbug/dbug
  23.  
  24.    .SETDIR=dbug/dbug : $(DBUG_SRC)
  25.  
  26.    # If DBMALLOC is requested (ie non-NULL) then include the sources for
  27.    # compilation.  BSD 4.3 needs the getwd.c source compiled in due to a bug
  28.    # in the clib getwd routine.
  29.    .IF $(DBMALLOC)
  30.       # Serious bug in bsd43 getwd.c would free a string and then use its
  31.       # value.  The DBMALLOC code clears a string when it is free'd so the
  32.       # value was no longer valid and the returned path for the current
  33.       # directory was now completely wrong.
  34.       .IF $(OSRELEASE) == bsd43
  35.      GETWD_SRC += getwd.c
  36.      .SETDIR=dbug : $(GETWD_SRC)
  37.       .END
  38.  
  39.       MLC_SRC   += malloc.c free.c realloc.c calloc.c string.c\
  40.            mlc_chk.c mlc_chn.c memory.c tostring.c m_perror.c\
  41.            m_init.c mallopt.c dump.c
  42.  
  43.       .SETDIR=dbug/malloc : $(MLC_SRC)
  44.  
  45.       DB_CFLAGS += -Idbug/malloc
  46.    .END
  47.  
  48.    SRC          += $(DBUG_SRC) $(MLC_SRC) $(GETWD_SRC)
  49.    HDR        += db.h 
  50.  
  51.    LDFLAGS    += $(DB_LDFLAGS)
  52.    LDLIBS    += $(DB_LDLIBS)
  53.  
  54.    SILENT    := $(.SILENT)
  55.    .SILENT    := yes
  56.    TARGET    := db$(TARGET)
  57.    OBJDIR    := $(OBJDIR).dbg
  58.    .SILENT    := $(SILENT)
  59.  
  60.    CFLAGS    += $(DB_CFLAGS)
  61.    .KEEP_STATE  := _dbstate.mk
  62. .ELSE
  63.    CFLAGS       += $(NDB_CFLAGS)
  64.    LDFLAGS      += $(NDB_LDFLAGS)
  65.    LDLIBS       += $(NDB_LDLIBS)
  66. .END
  67.